<?php

$action[] = 'header';
$action[] = $page;
if($widgets) {
    $action[] = 'widgets';
}
$action[] = 'footer';

loadSmarty($action, $data);